package com.wlw.layoutmanager.adapters;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;


public class BaseViewHolder<T extends View> extends RecyclerView.ViewHolder {
    public BaseViewHolder(@NonNull View itemView) {
        super(itemView);
    }

    public T getView(int resId) {
        return itemView.findViewById(resId);
    }

    public void setTextView(int resID, String text) {
        TextView textView = itemView.findViewById(resID);
        textView.setText(text);
    }

    public void setImageView(int resId, int resourceID) {
        ((ImageView) itemView.findViewById(resId)).setImageResource(resourceID);
    }
}
